package models;

import play.*;
import play.data.validation.Required;
import play.db.jpa.*;

import javax.persistence.*;

import java.util.*;

/**
 * 会员组
 * @author justin
 *
 */
@Entity
public class UserGroup extends BaseEntity {
	
	public enum UserGroupType {
		INHERENCE, TRANSIENT
		//固有组，临时组
	}
    
	public String name;
	
	public boolean isDefault;
	
	//组类型，例如：固有组，临时组（用于临时改价）
	@Required
	public UserGroupType type;
	
	//优先级
	@Required
	public int priority;
	
	@ManyToMany(mappedBy="groups")
	public List<User> users;
}
